package org.yray.tts.media;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;

@Slf4j
public class MediaReadFile {

    public static String filePath="D:\\test\\media";

    public static byte[] readBytes(String text,int format)
    {
        byte[] result=null;
        String fileName=filePath+ File.separator+format+File.separator+text+"_"+format+".wav";
        try {
            result= FileUtils.readFileToByteArray(new File(fileName));

        } catch (IOException e) {
            log.error(e.getMessage());
        }
        return result;
    }
}
